package com.jf.thread;

public class MyThread2 extends Thread{
    private MyInfo1 myInfo1;
    private MyInfo2 myInfo2;
    public MyThread2(MyInfo1 myInfo1,MyInfo2 myInfo2){
        this.myInfo1 = myInfo1;
        this.myInfo2 = myInfo2;
    }

    @Override
    public void run() {
        synchronized (myInfo2){
            try {
                sleep(500);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("info2等待结束，准备执行info1");
            myInfo1.show();
        }
    }
}
